package org.springframework.ai.dashscope.autoconfigure;

import org.springframework.ai.dashscope.DashscopeAiChatOptions;
import org.springframework.ai.dashscope.api.DashscopeAiApi;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.context.properties.NestedConfigurationProperty;

/**
 * @author wangjun
 */
@ConfigurationProperties(DashscopeAiChatProperties.CONFIG_PREFIX)
public class DashscopeAiChatProperties extends DashscopeAiParentProperties {

	public static final String CONFIG_PREFIX = "spring.ai.dashscope.chat";

	public static final String DEFAULT_CHAT_MODEL = DashscopeAiApi.ChatModel.QWEN_TURBO.value;

	private static final Double DEFAULT_TEMPERATURE = 0.7;

	private boolean enabled = true;

	@NestedConfigurationProperty
	private DashscopeAiChatOptions options = DashscopeAiChatOptions.builder()
		.model(DEFAULT_CHAT_MODEL)
		.temperature(DEFAULT_TEMPERATURE)
		.build();

	public DashscopeAiChatOptions getOptions() {
		return this.options;
	}

	public void setOptions(DashscopeAiChatOptions options) {
		this.options = options;
	}

	public boolean isEnabled() {
		return this.enabled;
	}

	public void setEnabled(boolean enabled) {
		this.enabled = enabled;
	}

}
